package com.hwl.demo12;

import com.hwl.demo12.entity.Work;

/**
 * 状态模式
 *
 * @author sentry
 * @since 2023-03-20
 */
public class Main {

    public static void main(String[] args) {
        Work work = new Work();
        work.setHour(9);
        work.writeProgram();

        work.setHour(10);
        work.writeProgram();

        work.setHour(12);
        work.writeProgram();

        work.setHour(14);
        work.writeProgram();

        work.setHour(17);

        work.setWorkFinished(false);
        // work.setWorkFinished(true);
        work.writeProgram();

        work.setHour(19);
        work.writeProgram();

        work.setHour(22);
        work.writeProgram();
    }
}
